{template 'common/header'}
{php load()->func('tpl')}
<style>
    .field label{float:left;margin:0 !important; width:140px;}
</style>
<ul class="nav nav-tabs">
    <li><a href="{php echo $this->createWebUrl('display')}">活动列表</a></li>
    <li><a href="{php echo $this->createWebUrl('post')}">新建活动</a></li>
    <li class="active"><a href="{php echo $this->createWebUrl('manage', array('id' => $reid))}">活动详情</a></li>
</ul>
<div class="main">
    <div class="panel panel-success">
        <div class="panel-heading">{if !empty($Thuodong['title'])}<font color=red>{$Thuodong['title']}</font>活动{/if}数据筛选</div>
        <div class="panel-body">
            <form action="./index.php" method="get" class="form-horizontal" role="form">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="meepo_weixiangqin" />
                <input type="hidden" name="do" value="manage" />
                <input type="hidden" name="id" value="{$reid}" />
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">内容情况</label>
                    <div class="col-xs-12 col-sm-8 col-lg-9">
                        <div style="font-weight:normal;">
                            <label class="checkbox-inline" id="field-all"><input type="checkbox" onchange="selectall(this, 'select');"> 全选</label>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label"></label>
                    <div class="col-xs-12 col-sm-8 col-lg-9">
                        {loop $ds $field $comment}
                        <label class="checkbox-inline"><input type="checkbox" name="select[]" value="{$field}" {if in_array($field, $select)} checked="checked"{/if} /> {$comment}</label>
                        {/loop}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">提交时间</label>
                    <div class="col-xs-12 col-sm-8 col-lg-4">
                        {php echo tpl_form_field_daterange('daterange',array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)))}
                    </div>
                    <div class=" col-xs-12 col-sm-2 col-lg-2">
                        <div class='btn-group'>
                        <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button><br><br><br><br>
                        <input type="submit" name="export" value="导出全部数据" class="btn btn-primary">
                        </div>
                    </div>
                    
                </div>
                <div class="form-group">
                </div>
            </form>
        </div>
    </div>
    <div class="panel panel-success">
        <div class="panel-heading">{if !empty($Thuodong['title'])}<font color=red>{$Thuodong['title']}</font>活动{/if}详细数据</div>
        <div class="panel-body">
            <form action="" method="post" onsubmit="">
                <table class="table table-hover">
                    <thead class="navbar-inner">
                        <tr>
                            <th width="25%">微信标识</th>
							<th width="15%">微信昵称</th>
							<th width="15%">头像</th>
                            {loop $select $fid}
                            <th max-width="40%">{$ds[$fid]}<i></i></th>
                            {/loop}
                            <th max-width="20%">提交时间<i></i></th>
                            <th max-width="15%">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {loop $list $row}
                        <tr>
                            <td class="row-hover"><a href="javascript:;" title="{$row['from_user']}">{$row['openid']}</a></td>
							<td class="row-hover">{$row['nickname']}</td>
							<td class="row-hover"><img width="50" src="{if preg_match('/http:(.*)/',$row['avatar'])}{$row['avatar']} {else if preg_match('/images(.*)/',$row['avatar'])} {$_W['attachurl']}{$row['avatar']}     {else}{MEEPORES}/static/friend/images/cdhn80.jpg{/if}" class="avatar" /></td>
                            {loop $select $fid}
                            <td>{$row['fields'][$fid]}<i></i></td>
                            {/loop}
                            <td style="font-size:12px; color:#666;">
                                {php echo date('Y-m-d H:i:s', $row[createtime]);}
                            </td>
                            <td>
								<a href="{php echo $this->createWebUrl('detail', array('id' => $row['rerid']))}" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="bottom" title="查看详情"><i class="fa fa-eye"></i></a>
								<a href="{php echo $this->createWebUrl('researchdelete', array('id' => $row['rerid']))}"  class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="bottom" title="删除"><i class="fa fa-times"></i></a>
							</td>
                        </tr>
                        {/loop}
                    </tbody>
                </table>
            </form>
            {$pager}
        </div>
    </div>
</div>
<script language='javascript'>
	function selectall(obj, name){
		$('input[name="'+name+'[]"]:checkbox').each(function() {
			$(this).get(0).checked =  $(obj).get(0).checked;
		});
	}
	require(['bootstrap'],function($){
		$('.btn').hover(function(){
			$(this).tooltip('show');
		},function(){
			$(this).tooltip('hide');
		});
	});
</script>
{template 'common/footer'}
